﻿@using JewererBasic
@model IEnumerable<BAG>

@{
    ViewBag.Title = "Bags In Process";

    var gd = new WebGrid(
            Model,
            canPage: true,
            rowsPerPage: 50,
            selectionFieldName: "selectedRow",
            ajaxUpdateContainerId: "gridContent"
        );
    gd.Pager(WebGridPagerModes.NextPrevious);
}

<h2>Bags In Process</h2>

<fieldset>

    <table>
        <tr>
            <td>
                <div>
                    @gd.GetHtml(
                tableStyle: "table",
                headerStyle: "head",
                rowStyle: "row",
                alternatingRowStyle: "altRow",
                selectedRowStyle: "selectRow",
                columns: gd.Columns(
                gd.Column(header: "Bag Id", format: @<div style="width: 150px; text-align: center;"><span><span id="spanId_@item.Id"><a href="@Url.Action("BagProcessDetail", "Order", new { id = item.Id })">@item.Id</a></span></span></div>),
                gd.Column(header: "Order Id", format: @<div style="width: 150px; text-align: center;"><span><span id="spanOrderId_@item.Id"><a href="@Url.Action("Details", "Order", new { id = item.ORDER_PRODUCT.IdOrder })">@item.ORDER_PRODUCT.IdOrder</a></span></span></div>),
                gd.Column(header: "Customer", format: @<div style="width: 150px; text-align: center;"><span><span id="spanCustomer_@item.Id">@item.ORDER_PRODUCT.ORDER.IdCustomer</span></span></div>),
                gd.Column(header: "Product", format: @<div style="width: 150px; text-align: center;"><span><span id="spanItem_@item.Id"><a href="@Url.Action("ExportReportProduct", "Report", new { productId = item.ORDER_PRODUCT.IdProduct })">@item.ORDER_PRODUCT.IdProduct</a></span></span></div>),
                gd.Column(header: "Finish Week", format: @<div style="width: 100px; text-align: center;"><span><span id="spanFinishWeek_@item.Id">@item.ORDER_PRODUCT.ORDER.FinishWeek</span></span></div>),
                gd.Column(header: "Type", format: @<div style="width: 100px; text-align: center;"><span><span id="spanType_@item.Id">@(item.ORDER_PRODUCT.PRODUCT.TYPE != null ? item.ORDER_PRODUCT.PRODUCT.TYPE.Name : "")</span></span></div>),
                gd.Column(header: "Size", format: @<div style="width: 100px; text-align: center;"><span><span id="spanSize_@item.Id">@(item.ORDER_PRODUCT.Size)</span></span></div>),
                gd.Column(header: "Quantity", format: @<div style="width: 100px; text-align: center;"><span><span id="spanQuantity_@item.Id">@item.Number</span></span></div>),
                gd.Column(header: "Weight", format: @<div style="width: 100px; text-align: center;"><span><span id="spanWeight_@item.Id">@item.Current_Weight</span></span></div>)
            ))
                </div>
            </td>
        </tr>
    </table>

</fieldset>
